package com.qf.leadnewsschedule.api;

import com.qf.leadnewsschedule.service.TaskinfoService;
import com.qf.qfleadnewsfeignapi.schedule.ScheduleApi;
import com.qf.qfleadnewsmodel.schedule.dtos.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ScheduleFeignApi implements ScheduleApi {

    @Autowired
    private TaskinfoService taskinfoService;

    @Override
    public void addTask(Task task) {
        taskinfoService.add(task);
    }

    @Override
    public Task consumeTask(Integer taskType, Integer priority) {
        return taskinfoService.consume(taskType,priority);
    }
}
